import type { InjectionKey, CSSProperties } from "vue";
import type { Placement } from "@floating-ui/dom";

export type { Placement };

export interface DropdownContext {
  handleItemClick: (command: any) => void;
}

export const DropdownContextKey: InjectionKey<DropdownContext> =
  Symbol("DropdownContext");

export interface DropdownMenuProps {
  // 定位
  placement?: Placement;
  offset?: number;
  // 触发
  trigger?: "click" | "hover";
  disabled?: boolean;
  // 行为
  hideOnClick?: boolean;
  teleported?: boolean;
  persistent?: boolean; // v-if / v-show
  // 外观
  maxHeight?: string | number;
  showArrow?: boolean;
  customClass?: string;
  customStyle?: CSSProperties;
}

export interface DropdownItemProps {
  command?: any;
  disabled?: boolean;
  divided?: boolean;
}
